<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D魔方</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        /*body {
            background: black;
        }
        */
        li {
            list-style: none;
        }

        /*重置*/

        ul {
            width: 200px;
            height: 200px;
            margin: 100px auto;
            position: relative;
            transform-style: preserve-3d;
            /*transform-origin: 50% 50% 50%;
            perspective: 20000px;*/
        }

        /*如果在ul里设置：-webkit-perspective:400px;-webkit-perspective-origin:0% 50%; 则会有透视、景深的效果*/

        li {
            width: 200px;
            height: 200px;
            position: absolute;
            text-align: center;
            line-height: 200px;
            font-size: 80px;
            font-weight: 700;
            color: #fff;
        }

        li:nth-child(1) {
            background: url("img/婷-5.jpg");
            transform: rotateX(90deg) translateZ(100px);
            background-size: 200px 200px;
        }

        li:nth-child(2) {
            background: url("img/婷-2.jpg");
            transform: rotateX(270deg) translateZ(100px);
            background-size: 200px 200px;
        }

        li:nth-child(3) {
            background: url("img/婷-7.jpg");
            transform: rotateY(90deg) translateZ(100px);
            background-size: 200px 200px;
        }

        li:nth-child(4) {
            background: url("img/婷-1.jpg");
            transform: rotateY(270deg) translateZ(100px);
            background-size: 200px 200px;
        }

        li:nth-child(5) {
            background: url("img/婷-3.jpg");
            transform: translateZ(-100px);
            background-size: 200px 200px;
        }

        li:nth-child(6) {
            background: url("img/婷-4.jpg");
            transform: translateZ(100px);
            background-size: 200px 200px;
        }

        /*****当执行下列css时，立方体无限自由旋转******/

        ul {
            animation: run 5s linear infinite;
        }

        @keyframes run {
            0% {
                transform: rotateX(0deg) rotateY(0deg);
            }
            100% {
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
    </style>
</head>

<body>
<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
</body>

</html>
</body>
</html>